home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************
- * TEXTRA AREXX script -- Mike Haas, 1991, All Rights Reserved. *
- * Freely distributable ONLY as a component of the TEXTRA package. *
- * This banner may not be removed or altered (improvements to the *
- * actual program welcome). Please document and send to me. *
- * !!! PLACE THIS FILE IN YOUR REXX: DIRECTORY !!! *
- ******************************************************************/
-
- /*
- ** JFComment.textra Mike Haas
- **
- ** Convienient for commenting out sections of code in Forth or assembler
- **
- ** Just select some lines of text and enter: JFComment
- **
- ** If the lines WERE commented out by a leading '\ ', it will be stripped.
- ** If they weren't, they are now!
- **
- ** note, you can enter a character such as... JFComment *
- **
- ** and the program will add that, plus a space at the start of
- ** each line. (It just uses '\' as a default)
- */
-
- /* 00001 mdh 20-nov-92 check version (cause of 'CheckCancel') */
- /* 00002 mdh 04-apr-94 no longer need selection, comment curs line */
-
- OPTIONS results
-
- rex = 0; result = "NOTSUPPORTED" /*00001*/
- textraversion
- parse var result maj min rex
- if (result == "NOTSUPPORTED") | (rex < 3) then do
- notify "Textra V1.13 or later required for this script."
- exit
- end
-
- parse arg thechar
-
- if (thechar == "") then
- thechar = "\"
-
- get select position
-
- if (result == "NO SELECT") then do /* is nothing selected? */
-
- get cursor position /*00002 */
- parse var result startx' 'starty
- endx = 0
- endy = starty + 1
-
- end
- else
-
- /* yes, there is a selection, get it's boundaries */
- parse var result startx ' ' starty ' ' endx ' ' endy
-
- currx = startx
- curry = starty
-
- /* if nothing on the endline is actually selected, don't include it */
- if (endx == 0) then endy = endy - 1
-
-
-
- do while (curry <= endy)
-
- CheckCancel; if (result == CANCEL) then exit
-
- do
-
- gotoxy 0 curry; get cursor char
- if (result == thechar) then do
- del
- get cursor char
- if ((result == " ") | (result == " ")) then do
- del
- end
- end
- else do
- text thechar" ";
- end
-
- curry = curry + 1
- end
-
- end
-
-